/**
 *
 */
package jp.seraph.same.view.cui;

import jp.seraph.cui.AbstractCommand;
import jp.seraph.cui.InternalConsole;
import jp.seraph.cui.Mode;
import jp.seraph.cui.SystemNode;
import jp.seraph.cui.SystemNodeType;
import jp.seraph.same.controller.PoseManagerController;

/**
 *
 *
 */
public class DeletePoseCommand extends AbstractCommand {
    public DeletePoseCommand(Mode aParent, InternalConsole aConsole, PoseManagerController aManagerController){
        super(aParent, aConsole);

        mManagerController = aManagerController;
    }

    private PoseManagerController mManagerController;

    /**
     *
     * @see jp.seraph.cui.AbstractCommand#executeImpl(jp.seraph.cui.SystemNode[], int)
     */
    @Override
    protected void executeImpl(SystemNode[] aArgs, int aArgListIndex) {
        String tName = aArgs[0].getName();
        aArgs[0].delete();

        mManagerController.removePose(tName);
    }

    /**
     *
     * @see jp.seraph.cui.Command#getArgumentTypes()
     */
    public SystemNodeType[][] getArgumentTypes() {
        SystemNodeType[][] tResult = new SystemNodeType[1][];

        tResult[0] = new SystemNodeType[]{ PoseDataType.getInstance() };

        return tResult;
    }

    /**
     *
     * @see jp.seraph.cui.Command#getHelp()
     */
    public String getHelp() {
        return "rmp PoseData : Delete PoseData";
    }

    /**
     *
     * @see jp.seraph.cui.SystemNode#getName()
     */
    public String getName() {
        return "rmp";
    }

    /**
     *
     * @see jp.seraph.cui.SystemNode#getType()
     */
    public SystemNodeType getType() {
        return DeletePoseCommandType.getInstance();
    }

    /**
     *
     * @see jp.seraph.cui.SystemNode#isRoot()
     */
    public boolean isRoot() {
        return false;
    }

}
